<!--
 * @Author: dumin 173672326@qq.com
 * @Date: 2025-03-12 00:23:55
 * @LastEditors: dumin 173672326@qq.com
 * @LastEditTime: 2025-03-21 11:18:31
 * @Description: 添加参会人员
-->
<template>
  <jax-dialog-edit
    title="新增参会人员"
    v-model="detail"
    v-model:show="model"
    :json="formJson"
    type="dialog"
    label-width="85px"
    @submit="$emit('confirm', detail)"
  />
</template>

<script setup>
import { useAppStore } from 'jax-node'

const model = defineModel({ type: Boolean, default: false })
const emits = defineEmits(['confirm'])
const { dict } = useAppStore()

const detail = ref({})

const formJson = computed(() => {
  const required = true

  return [
    { name: 'name', label: '人员姓名', required },
    { name: 'mobile', label: '手机号', required, inputAttr: { maxlength: 11 } },
    { name: 'company', label: '所属单位', required },
    { name: 'jobTitle', label: '职务' },
    { name: 'role', label: '参会角色', type: 'select', required, options: dict.meetRole },
  ]
})
</script>
